package MyFile;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class demo3 {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("D:\\software\\code\\2023_java\\2023_java_code\\code_24_4_18\\src\\Text.text");
        File file = new File("D:\\software\\code\\2023_java\\2023_java_code\\code_24_4_18\\src\\Text.text");
        long size = file.length();
        byte[] bytes = new byte[(int) size];
        int n = inputStream.read(bytes);
        System.out.println("n:"+n);
        System.out.println("size:"+size);
        System.out.println(new String(bytes));
        inputStream.close();
    }
}

